<template>
  <div class="twoxm-cart">
    <div class="twoxm-cart-list">
      <MyCartItem
        v-for="shop in cart"
        :key="shop.id"
        :id="shop.id"
        :title="shop.title"
        :img="shop.img"
        :price="shop.price"
        :count="shop.count"
        :check="shop.check"
      />
    </div>
    <p>总价:￥{{ totalMoney | toFix2 }}元</p>
  </div>
</template>

<script>
import MyCartItem from '@/components/MyCartItem'
import { createNamespacedHelpers } from 'vuex'

const cart = createNamespacedHelpers('cart')

export default {
  name: 'cart',
  components: {
    MyCartItem
  },
  computed: {
    ...cart.mapState(['cart']),
    ...cart.mapGetters(['totalMoney'])
  }
}
</script>

<style>

</style>
